//
//  DailyInspectionView.m
//  PropertyMananger
//
//  Created by bh on 17/1/24.
//  Copyright © 2017年 BH. All rights reserved.
//

#import "DailyInspectionView.h"

@implementation DailyInspectionView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        self.titleLabel = [[UILabel alloc]init];
        [self addSubview:self.titleLabel];
      //  self.titleLabel.backgroundColor = BHRandColor;
        
        self.titleLabel.text = @"巡检日志";
        self.titleLabel.textColor = BHColor(102, 102, 102);
        self.titleLabel.font = BHFont(15);
        
        self.titleLabel.textAlignment = NSTextAlignmentLeft;
        [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.leading.equalTo(self).with.offset(15);
            make.top.equalTo(self).with.offset(15);
            make.size.mas_equalTo(CGSizeMake(70, 25));
        }];
        
        self.textView = [[PlaceholderTextView alloc]init];
        [self addSubview:self.textView];
        self.textView.backgroundColor = [UIColor whiteColor];
        self.textView.delegate = self;
        self.textView.font = [UIFont systemFontOfSize:14.f];
        self.textView.textColor = [UIColor blackColor];
        self.textView.textAlignment = NSTextAlignmentLeft;
        self.textView.editable = YES;
        self.textView.layer.cornerRadius = 4.0f;
        self.textView.layer.borderColor = BHColor(102, 102, 102).CGColor;
        self.textView.layer.borderWidth = 0.1;
        self.textView.placeholderColor = BHColor(102, 102, 102);
        self.textView.placeholder = @"请输入巡检内容...";
        
        
        [self.textView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.leading.equalTo(self).with.offset(15);
            make.top.equalTo(self.titleLabel.mas_bottom).with.offset(5);
            make.size.mas_equalTo(CGSizeMake(BHscreenW - 30, 190));
        }];
        
        UILabel * recordLabel = [[UILabel alloc]init];
        [self addSubview:recordLabel];
        recordLabel.text = @"记录时间";
      //  recordLabel.backgroundColor = BHRandColor;
        
        recordLabel.textColor = BHColor(102, 102, 102);
        recordLabel.textAlignment = NSTextAlignmentLeft;
        recordLabel.font = BHFont(15);
        
        [recordLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.leading.equalTo(self.textView).with.offset(0);
            make.top.equalTo(self.textView.mas_bottom).with.offset(15);
            make.size.mas_equalTo(CGSizeMake(70, 25));
        }];
        
        self.recordLabel = [[UILabel alloc]init];
        [self addSubview:self.recordLabel];
        self.recordLabel.textAlignment = NSTextAlignmentLeft;
        
        self.recordLabel.textColor = BHColor(51, 51, 51);
        self.recordLabel.font = BHFont(15);
        self.recordLabel.text = @"2016-08-03";
        
        [self.recordLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.leading.equalTo(recordLabel.mas_trailing).with.offset(10);
            make.top.equalTo(recordLabel).with.offset(0);
            make.size.mas_equalTo(CGSizeMake(BHscreenW/2, 25));
        }];
        
        UILabel * recordManLabel = [[UILabel alloc]init];
        [self addSubview:recordManLabel];
        recordManLabel.text = @"记录人";
        
        recordManLabel.textColor = BHColor(102, 102, 102);
        recordManLabel.textAlignment = NSTextAlignmentLeft;
        recordManLabel.font = BHFont(15);
        
        [recordManLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.leading.equalTo(recordLabel).with.offset(0);
            make.top.equalTo(recordLabel).with.offset(30);
            make.size.mas_equalTo(CGSizeMake(70, 25));
        }];
        
        self.recordManLabel = [[UILabel alloc]init];
        [self addSubview:self.recordManLabel];
        self.recordManLabel.textAlignment = NSTextAlignmentLeft;
        
        self.recordManLabel.textColor = BHColor(51, 51, 51);
        self.recordManLabel.font = BHFont(15);
        self.recordManLabel.text = @"陈小黑";
        
        [self.recordManLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.leading.equalTo(recordManLabel.mas_trailing).with.offset(10);
            make.top.equalTo(recordManLabel).with.offset(0);
            make.size.mas_equalTo(CGSizeMake(BHscreenW/2, 25));
        }];
        
        self.confirmButton = [UIButton buttonWithType:UIButtonTypeCustom];
        [self addSubview:self.confirmButton];
        self.confirmButton.backgroundColor = Theme_Color;
        
        self.confirmButton.layer.masksToBounds = YES;
        self.confirmButton.layer.cornerRadius = 5;
        
        [self.confirmButton setTitle:@"提交保存" forState:UIControlStateNormal];
        [self.confirmButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
        [self.confirmButton  mas_makeConstraints:^(MASConstraintMaker *make) {
            make.leading.equalTo(self).with.offset(15);
            make.top.equalTo(recordManLabel.mas_bottom).with.offset(35);
            make.size.mas_equalTo(CGSizeMake(BHscreenW - 30, 44));
            
            
        }];


        
    }
    return self;
}

@end
